package com.itheima.mapper;

import com.itheima.pojo.Student;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 学生持久层接口
 * @author GY
 * @version V1.0
 * @date 2025-01-14 11:40
 */
@Mapper
public interface StudentMapper {

    List<Student> pageQuery(Student student);

    void deleteByIds(@Param("ids") List<Integer> ids);

    void save(Student student);

    Student queryById(Integer id);

    void update(Student student);

    void deductPointsById(@Param("id") Integer id, @Param("score") Integer score);

    Integer countByName(String name);

    Integer countByPhone(String phone);

    @MapKey("degree")
    List<Map<String, Object>> studentFindByDegree();

    @MapKey("clazz")
    List<Map<String, Object>> studentFondByClazz();
}
